package demo;

public class GoldCard extends Card
{
    public GoldCard(String carid, String name, String phonenumber, double money)
    {
        super(carid, name, phonenumber, money);
    }

    @Override
    public void consume(double money)
    {
        System.out.println("您当前消费：" + money);
        System.out.println("优惠后的金额为：" + money * 0.8);
        if(getMoney()<money * 0.8)
        {
            System.out.println("余额不足！请充值！");
            return;
        }
        else
        {
            setMoney(getMoney() - money* 0.8);
            System.out.println("支付成功！您的余额为"+ getMoney());
        }
        //打印洗车卷
        print();
    }
    void print()
    {
        System.out.println("您已获得一张洗车券！");
    }
}
